package com.jvm;

// 采用静态内部类实现单例模式
public class Singleton2 {

    private Singleton2() {
        //
    }

    private static class Singleton2Handler {
        private static Singleton2 instance = new Singleton2();
    }

    public static Singleton2 getInstance() {
        return Singleton2Handler.instance;
    }

}
